﻿using System.Windows;
using StockholmsStad.Windows.UI.Modules.MainModule.Interfaces;
using StockholmsStad.Windows.UI.Modules.MainModule.Models;

namespace StockholmsStad.Windows.UI.Modules.MainModule.Views
{
    /// <summary>
    /// Interaction logic for ToggleBarView.xaml
    /// </summary>
    public partial class ToolBarView : IToolBarView
    {
        private readonly IViewController viewController;

        public ToolBarView(IViewController viewController)
        {
            this.viewController = viewController;
            InitializeComponent();
        }

        #region IToolBarView Members

        public ToolBarPresentationModel Model
        {
            get { return DataContext as ToolBarPresentationModel; }
            set { DataContext = value; }
        }

        #endregion

        private void ToggleBar_Click(object sender, RoutedEventArgs e)
        {
            var element = e.Source as FrameworkElement;
            viewController.OnViewSelected(element);
        }
    }
}
